package com.ricky.sms.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtils implements InitializingBean {
    //生产环境请求地址：app.cloopen.com
    @Value("${cloopen.sms.serverIp}")
    private String serverIp;
    //请求端口
    @Value("${cloopen.sms.serverPort}")
    private String serverPort;
    //主账号,登陆云通讯网站后,可在控制台首页看到开发者主账号ACCOUNT SID和主账号令牌AUTH TOKEN
    @Value("${cloopen.sms.accountSId}")
    private String accountSId;
    @Value("${cloopen.sms.accountToken}")
    private String accountToken;
    //请使用管理控制台中已创建应用的APPID
    @Value("${cloopen.sms.appId}")
    private String appId;

    public static String SERVER_IP;
    public static String SERVER_PORT;
    public static String ACCOUNT_SID;
    public static String ACCOUNT_TOKEN;
    public static String APPID;

    @Override
    public void afterPropertiesSet() throws Exception {
        SERVER_IP=serverIp;
        SERVER_PORT=serverPort;
        ACCOUNT_SID=accountSId;
        ACCOUNT_TOKEN=accountToken;
        APPID=appId;

    }
}
